﻿using RAP.Web.Libary.Common.Model;
using System;
using System.Threading.Tasks;

namespace RAP.Web.Libary.Controller
{
  /// <summary>
  /// 控制器对象接口
  /// </summary>
  public interface IWebController
  {
    /// <summary>
    /// 
    /// </summary>
    IServiceProvider ServiceProvider { get; }

    /// <summary>
    /// 
    /// </summary>
    string NamePsace { get; }

    /// <summary>
    /// 
    /// </summary>
    IAPIQueryParams QueryParams { get; set; }

    /// <summary>
    /// 
    /// </summary>
    /// <param name="data"></param>
    /// <returns></returns>
    JsonResult JSONContent(object data);

    /// <summary>
    /// 
    /// </summary>
    /// <param name="errorMessage"></param>
    /// <param name="errorCode"></param>
    /// <returns></returns>
    Task<JsonResult> ErrorContent(string errorMessage, int errorCode = int.MaxValue);

    /// <summary>
    /// 
    /// </summary>
    /// <returns></returns>
    Task<JsonResult> InvalidSession();
  }
}
